<template>
	<view class="home">
		<view class="assistant">
			<view class="fixfix">
				<view class="file_list">

					<view class="file_item topImgBox">
						<view class="carPicBox">
							<view class="idcardimg">
								<!-- <image class="carPpic" v-if="idCardloadImg1 == ''"
									src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/upload/1728637901347825.png"
									mode="widthFix" @click="uploadImage(0)" /> -->
								<image class="carPpic" v-if="idCardloadImg1 == ''"
									src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/upload/1728637901347825.png"
									mode="widthFix" @click="iscro = true" />
								<block v-else>
									<image class="carPpic" :src="idCardloadImg1" mode="aspectFill"
										@click="previewImage(idCardloadImg1)" />
									<image class="closeImg"
										src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/upload/17286381577091384.png"
										mode="widthFix" @click.stop="delIdCard('idCardloadImg1')" />
								</block>

							</view>
							<view class="idcardimg">
								<!-- <image class="carPpic" v-if="idCardloadImg2 == ''"
									src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/upload/1728637917926871.png"
									mode="widthFix" @click="uploadImage(1)" /> -->
								<image class="carPpic" v-if="idCardloadImg2 == ''"
									src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/upload/1728637917926871.png"
									mode="widthFix" @click="iscro2 = true" />
								<block v-else>
									<image class="carPpic" :src="idCardloadImg2" mode="aspectFill"
										@click="previewImage(idCardloadImg2)" />
									<image class="closeImg"
										src="https://mg-print.oss-cn-shenzhen.aliyuncs.com/upload/17286381577091384.png"
										mode="widthFix" @click.stop="delIdCard('idCardloadImg2')" />
								</block>

							</view>
						</view>

					</view>
				</view>
				<view class="file_list" v-if="uploadFileList.length > 0">
					<view class="file_item" v-for="(item, index) in uploadFileList" :key="index">
						<view class="right">
							<view class="top">
								<text>{{ item.name }}</text>
								<!-- <text style="min-width: 265rpx;text-align: right;">{{ item.time.slice(0, -3) }}</text> -->
							</view>

							<view class="setting_list">
								<block v-for="(tag, indexx) in item.tags" :key="indexx">
									<view class="setting_item" v-if="tag.text != '打印份数' && indexx < 2">
										<text>{{ tag.PCName || tag.PCName || tag.text }}</text>
										<!-- 为选项时 -->
										<view class="right" style="flex-direction: row; justify-content: flex-end;"
											v-if="tag.type == 'choose'">
											<view v-for="(it, tagIndex) in tag.list" :key="tagIndex"
												@click="changeTagSelect2(tag, tagIndex, item, indexx)">
												<view :class="['tags', it.isSelect ? 'is_active' : '']">
													{{ it.PMName || it.PCName || it.PapeTrypeName }}
												</view>
											</view>
										</view>
										<view v-if="tag.type == 'page'"
											style="display: flex; align-items: center; flex: 1; justify-content: flex-end;">
											<input @blur="changeTag(tag)" type="number" v-model="tag.value"
												style="text-align:center;max-width: 100rpx; border: 1rpx solid #3572fe; " />-<input
												@blur="changeEndTag(tag)"
												style="text-align:center;max-width: 100rpx; border: 1rpx solid #3572fe;"
												type="number" v-model="tag.TrailerPage" />
										</view>
									</view>
								</block>
							</view>
							<view
								style="display: flex; justify-content: flex-end; align-items: center; font-size: 24rpx; margin: 15rpx 0;">
								<uni-number-box v-model="item.copies" /> <text style="margin-left: 10rpx;"> 份</text>
							</view>
							<view class="bottom">
								<text class="price">{{ returnPrice(item) }}</text>
								<view class="status">

								</view>
							</view>
						</view>
					</view>
				</view>
				<block v-else>
					<EmptyBox text="暂无文件哦～"></EmptyBox>
				</block>
				<!-- 全选 -->
				<view class="select_all" v-if="uploadFileList.length > 0">
					<view class="select_all_left">
						<text class="select_all_price" v-if="totalPrice == couPrice">￥{{ totalPrice }}</text>
						<text class="select_all_price" v-else>￥{{ couPrice }} <text class="delPrice">￥{{ totalPrice
								}}</text></text>
					</view>
					<button :class="['print_button', selectedCount == 0 ? 'cantpay' : '']"
						:disabled="selectedCount == 0" @click="printNow">立刻打印({{ selectedCount }})</button>
				</view>
				<!-- 占位盒子 -->
				<view v-if="uploadFileList.length > 0" style="height: 100rpx;"></view>
				<view v-if="uploadFileList.length == 0" style="height: 60rpx;"></view>
			</view>
		</view>
		<qf-image-cropper v-if="iscro" :src="idCardloadImg1" :zIndex="99" :width="302" :height="189"
			@crop="cropView"></qf-image-cropper>
		<qf-image-cropper v-if="iscro2" :src="idCardloadImg2" :zIndex="99" :width="302" :height="189"
			@crop="cropView2"></qf-image-cropper>
	</view>
</template>

<script>
import {
	mapState
} from 'vuex'
export default {
	components: {

	},
	data() {
		return {
			iscro: false,
			iscro2: false,
			showFileSetting: false,
			settingList: [],
			settingIndex: 0,
			showChooseFile: false,
			uploadFileList: [], // 上传文件List
			backgroundColor: 'rgba(255, 255, 255, 0)', //顶部背景颜色
			imgList: [],
			user: {}, //个人信息
			userinfo: {}, // 完整的个人信息
			load: false, //是否加载
			PageIndex: 1, //页码
			shopList: [], //商品列表
			isMore: true, //是否还有更多
			isNav: false,
			shopOption: {},
			chooseData: { //选择纸张属性
				PapeTrypeCode: '',
				PCCode: '',
				PMCode: '',
			},
			addressInfo: '',
			PageSize: 10,
			uploadOption: '',
			selectIndex: '',
			showMoreFile: false,
			scene: 0, //0:为非扫码，其他为扫码进来用户
			isFirst: true,//判断是否是第一次进入
			chooseIndex: null,//点击进入的索引
			idCardloadImg1: '',//上传的身份证正面
			idCardloadImg2: '',//上传的身份证反面
			couponList: [],
		};
	},
	computed: {
		selectedCount() {
			return this.uploadFileList.filter(file => file.isSelect).length;
		},
		totalPrice() {
			// 计算总价格
			const total = this.uploadFileList
				.filter(file => file.isSelect && file.configure)
				.reduce((total, file) => total + file.price, 0);
			console.log(total, 'totaltotaltotal');

			// 向下取整并保留两位小数
			const roundedTotal = Math.floor(total * 100) / 100;

			return roundedTotal.toFixed(2); // 返回保留两位小数的字符串
		},
		couPrice() {
			const num = this.uploadFileList
				.filter(file => file.isSelect && file.configure)
				.reduce((total, file) => total + (file.generalPage * file.copies), 0);

			const list = this.couponList
			const discount = list
				.filter(file => num >= file.StartNum && num < file.EndNum)



			const piceDis = discount.length > 0 ? discount[0].Discount : 10

			const price = Number(piceDis) / 10 * this.totalPrice;
			console.log(piceDis, 'piceDispiceDis', price);
			return price.toFixed(2)
		},

	},

	async onShow() {

	},
	onLoad(e) {
		this.getCouList()
		this.getShopSale()
	},
	onReachBottom() {

	},
	onUnload() {

	},
	methods: {
		async uploading(url, tempKey, index) {
			console.log('url ----------' + url);

			const r = await this.$upload(url, (pro) => { });
			if (r) {
				let name = index == 0 ? 'idCardloadImg1' : 'idCardloadImg2'
				this.$pv.msg('上传成功')
				this[name] = r
				this.iscro = false
				this.iscro2 = false
			} else {
				this.$pv.msg('上传失败')
			}
			console.log('upload file ' + r);
			// this.formdata.PhotoUrl.push(r);
			// this.formdata.PhotoUrl = r
		},
		// 点击选择图片
		uploadImage(index = 0) {
			let _this = this;
			uni.chooseMedia({
				count: 1,
				mediaType: ['image'],
				sourceType: ['album', 'camera'],
				maxDuration: 30,
				camera: 'back',
				success(res) {
					console.log(res);
					res.tempFiles.forEach(async (item) => {
						let o = {
							duration: 0,
							fileType: item.fileType,
							tempUrl: item.tempFilePath,
							flieUrl: item.tempFilePath,
							tempKey: uni.$u.guid(8),
							pro: 0,
						};
						let rex = await _this.uploading(o.flieUrl, o.tempKey, index);
						console.log('rex-------', rex);
					});
				},
			});
		},
		async cropView(e) {
			let _this = this;
			let o = {
				ID: "",
				duration: 0,
				fileType: "image",
				tempUrl: e.tempFilePath,
				flieUrl: e.tempFilePath,
				tempKey: uni.$u.guid(8),
				pro: 0,
				netPath: "",
			};
			let rex = await _this.uploading(o.flieUrl, o.tempKey, 0);
		},
		async cropView2(e) {
			let _this = this;
			let o = {
				ID: "",
				duration: 0,
				fileType: "image",
				tempUrl: e.tempFilePath,
				flieUrl: e.tempFilePath,
				tempKey: uni.$u.guid(8),
				pro: 0,
				netPath: "",
			};

			let rex = await _this.uploading(o.flieUrl, o.tempKey, 1);
		},
		// 删除身份证照片
		delIdCard(name) {
			this[name] = ''
		},
		changeTag(e) {
			if (e.value > e.currentPage) {
				e.value = e.currentPage - 1
			}
			if (e.value < 0 || e.value == 0) {
				e.value = 1
			}
		},
		changeEndTag(e) {
			if (e.TrailerPage < e.value) {
				e.TrailerPage = e.value;
			} else if (e.TrailerPage <= 0) {
				e.TrailerPage = e.value;
			} else if (e.TrailerPage < e.value && e.value !== 1) {
				e.value = e.TrailerPage - 1;
			}
			else if (e.TrailerPage > e.currentPage) {
				e.TrailerPage = e.currentPage
			}
		},
		showMore() {
			this.showChooseFile = false
			this.showMoreFile = true
		},
		returnPrice(item) {
			console.log(item, 'eewewewe');

			// 份数
			let copies = item.copies
			// item.tags.forEach(tag => {
			// 	if (tag.type === "total") {
			// 		copies = tag.value;
			// 	}
			// });
			const result = {};
			// 找出对应配置,
			item.tags.forEach(tag => {
				if (tag.type === 'choose') {
					tag.list.forEach(item => {
						if (item.isSelect) {
							if (tag.text === "纸张类型") {
								result.PapeTrypeCode = item.PapeTrypeCode;
							} else if (tag.text === "色彩") {
								result.PCCode = item.PCCode;
							} else if (tag.text === "单双面") {
								result.PMCode = item.PMCode;
							}
						}
					});
				}
			});
			//找到对应规格的下标
			const indices = this.shopOption.Printing.map((item, index) =>
				(item.PapeTrypeCode === result.PapeTrypeCode &&
					item.PCCode === result.PCCode &&
					item.PMCode === result.PMCode) ? index : -1
			).filter(index => index !== -1);
			if (indices.length == 0) {
				item.configure = false
				return '请选择配置'
			}
			const priceBell = this.shopOption.Printing[indices[0]];
			const isVip = this.shopOption.IsMember;
			const singleOrDoubleSideTag = item.tags.find(tag => tag.text === "单双面");
			let singleSideIsSelect = ''
			let doubleSideIsSelect = ''
			if (singleOrDoubleSideTag) {
				// 获取“单双面”标签中的“list”数组
				const list = singleOrDoubleSideTag.list;

				// 提取“单面”和“双面”的 isSelect 状态
				const singleSide = list.find(item => item.PMName === "单面");
				const doubleSide = list.find(item => item.PMName === "双面");

				singleSideIsSelect = singleSide ? singleSide.isSelect : null;
				doubleSideIsSelect = doubleSide ? doubleSide.isSelect : null;
			} else {

			}
			// 根据是否是会员计算价格
			let price;
			let pageDetail = {}
			item.tags.forEach((item) => {
				if (item.type === 'page') {
					pageDetail.TrailerPage = item.TrailerPage
					pageDetail.value = item.value
				}
			})
			if (isVip) {

				if (priceBell.MemberType === 1) {
					price = priceBell.MembershipPrice * copies * (singleSideIsSelect ? (Number(pageDetail.TrailerPage) - Number(pageDetail.value) + 1) : Math.ceil(
						(Number(pageDetail.TrailerPage) - Number(pageDetail.value) + 1) / 2)); // 会员价 * 份数 *页数
				} else if (priceBell.MemberType === 2) {
					price = copies * priceBell.DiscountedPrice * (singleSideIsSelect ? (Number(pageDetail.TrailerPage) - Number(pageDetail.value) + 1) : Math.ceil((Number(pageDetail.TrailerPage) - Number(pageDetail.value) + 1) / 2)) // 原价 * 折扣 * 份数
				}
			} else {
				price = priceBell.OriginalPrice * copies * (singleSideIsSelect ? (Number(pageDetail.TrailerPage) - Number(pageDetail.value) + 1) : Math.ceil((Number(pageDetail.TrailerPage) - Number(pageDetail.value) + 1) / 2)) // 原价 * 份数
			}
			console.log('priceBell.OriginalPrice--' + priceBell.OriginalPrice, '--copies---' + copies, '--singleSideIsSelect--' + singleSideIsSelect, '--TrailerPage--' + Number(pageDetail.TrailerPage), '--value--' + Number(pageDetail.value), '---last--' + Math.ceil((Number(pageDetail.TrailerPage) - Number(pageDetail.value) + 1) / 2));

			item.price = price
			item.configure = true
			// 向下取整并保留两位小数
			return `￥${(Math.floor(price * 100) / 100).toFixed(2)}`;
		},
		async getShopSale() {
			if (this.$store.state.storeInfo.ID) {
				let res = await this.$api.post("Printing/GetPrinting", {
					Shops_ID: this.$store.state.storeInfo.ID,
					UserID: uni.getStorageSync("user").UserID
				})
				this.shopOption = res.data
				this.getFileList()
			}

		},
		retuenClass(item, index) {
			if (item.PapeTrypeCode == this.chooseData.PapeTrypeCode) {
				return 'is_active';
			} else if (item.PCCode == this.chooseData.PCCode) {
				return 'is_active';
			} else if (item.PMCode == this.chooseData.PMCode) {
				return 'is_active';
			}
			return '';
		},

		changeTagSelect2(tags, tagsIndex, item) {
			this.settingList = item
			// 取消选择所有项目
			tags.list.forEach(item => item.isSelect = false);
			tags.list[tagsIndex].isSelect = true;
			const result = {};

			// 遍历设置列表中的所有标签
			this.settingList.tags.forEach(tag => {
				if (tag.type === 'choose') { // 只处理类型为 'choose' 的标签
					tag.list.forEach(item => {
						if (item.isSelect) { // 如果项目被选择
							// 根据标签的文本类型，将相应的值存储到 result 对象中
							if (tag.text === "纸张类型") {
								result.PapeTrypeCode = item.PapeTrypeCode;
							} else if (tag.text === "色彩") {
								result.PCCode = item.PCCode;
							} else if (tag.text === "单双面") {
								result.PMCode = item.PMCode;
							}
						}
					});
				}
			});

			// 获取所有符合条件的选项
			const selectedItems = this.settingList.tags
				.filter(tag => tag.type === 'choose') // 只处理类型为 'choose' 的标签
				.flatMap(tag => tag.list.filter(item => {
					// 确定项目是否应该被选中
					const shouldSelect = this.shopOption.Printing.some(printItem =>
						(!result.PapeTrypeCode || printItem.PapeTrypeCode === result.PapeTrypeCode) &&
						(!result.PCCode || printItem.PCCode === result.PCCode) &&
						(!result.PMCode || printItem.PMCode === result.PMCode)
					);
					// 检查项目是否匹配标签的条件
					const matchesTag = (
						(tag.text === "纸张类型" && item.PapeTrypeCode === result.PapeTrypeCode) ||
						(tag.text === "色彩" && item.PCCode === result.PCCode) ||
						(tag.text === "单双面" && item.PMCode === result.PMCode)
					);
					return shouldSelect && matchesTag; // 返回是否应当选择该项目
				}));
			if (selectedItems.length == 0) {
				uni.showToast({
					title: `门店暂不支持此搭配打印，请重新选择`,
					icon: `none`
				})
			}
			// 更新每个标签中的项目选择状态
			this.settingList.tags.forEach(tag => {

				if (tag.type === 'choose') {
					tag.list.forEach(item => {
						// 更新项目的选择状态

						item.isSelect = selectedItems.includes(item);
					});
				}
			});

		},
		changeSelectAll() {
			// 全选反选
			this.isSelectedAll = !this.isSelectedAll
			this.uploadFileList.forEach((item) => {
				item.isSelect = this.isSelectedAll
			})
		},
		changeSelect(item) {

			item.isSelect = !item.isSelect
		},
		fileListAdd(file) {
			const tagTypes = {
				PcData: '色彩',
				PmData: '单双面',
				PtData: '纸张类型'
			};

			let tags = [];

			Object.entries(this.shopOption).forEach(([key, value]) => {
				if (tagTypes[key]) {
					tags.push({
						type: 'choose',
						text: tagTypes[key],
						list: value.map((item, index) => ({
							...item,
							isSelect: index == 0 ? true : false // 将第0项的 isSelect 设置为 true，其余项为 false
						}))
					});
				}
			});

			tags.push({
				type: 'total',
				text: '打印份数',
				value: 1,
				list: [{}]
			});
			tags.push({
				type: 'page',
				text: '打印页数',
				list: [{}],
				value: 1,
				TrailerPage: file?.GeneralPage ? file.GeneralPage : 1,
				currentPage: file?.GeneralPage ? file.GeneralPage : 1,
			});
			console.log(file, 'filefilefile');

			console.log(this.uploadFileList, 'qqdadasdasdasdasdasdasdsa');
			this.uploadFileList.push({
				name: `身份证打印`,
				type: file?.Suffix,
				time: file?.UploadDate.replace('T', ' '),
				Url: file?.Url,
				generalPage: file?.GeneralPage == 0 ? 1 : file?.GeneralPage,
				isSelect: true,
				tags,
				price: Number(0),
				FileCode: file?.FileCode,
				configure: true,
				FileType: file?.FileType,
				copies: 1,
				isThrottled: '',
			});
			console.log(this.uploadFileList, 'pppppppppppppp');

		},
		async getFileList() {
			this.uploadFileList = [] //清空文件列表，再次发起请求，避免数据不对

			let data = {
				DeviceCode: null,
				FileCode: "1cfabf91-afdf-406f-81f8-c077d72f7a64",
				FileID: 18607,
				FileName: "身份证打印",
				FileType: "jpg",
				GeneralPage: 1,
				IsDelete: 0,
				Shops_ID: "11039",
				Suffix: "jpg",
				UploadDate: "2024-10-10T13:55:40",
				Url: "https://mg-print.oss-cn-shenzhen.aliyuncs.com/upload/1728539735836218.txt",
				UserID: "481836",
			}
			this.fileListAdd(data)

		},
		async printNow() {
			let that = this
			if (this.$store.state.storeInfo.IsState === 'false') {
				uni.showToast({
					title: `门店离线，请选择其他门店打印`,
					icon: 'none'
				});
				return;
			}

			// 节流逻辑
			if (this.isThrottled) {
				return; // 如果在节流时间内，直接返回
			}
			this.isThrottled = true; // 设置为正在执行

			setTimeout(() => {
				this.isThrottled = false; // 重置为可以执行
			}, 3000); // 设定节流时间为 3 秒

			try {

				// 生成结果数组
				const arr = this.uploadFileList
					.filter(item => item.isSelect && item.configure) // 过滤出已选择的文件
					.map(item => {
						const obj = {}; // 存储每个文件的处理结果
						const obj2 = {}; // 用于存储标签的选择结果
						obj.Number = item.copies;
						item.tags.forEach(tag => {
							if (tag.type === 'choose') {
								tag.list.forEach(itm => {
									if (itm.isSelect) {
										// 根据标签文本类型存储相应的值到 obj2 中
										switch (tag.text) {
											case "纸张类型":
												obj2.PapeTrypeCode = itm.PapeTrypeCode;
												break;
											case "色彩":
												obj2.PCCode = itm.PCCode;
												break;
											case "单双面":
												obj2.PMCode = itm.PMCode;
												break;
										}
									}
								});

								// 查找匹配的打印选项
								const matchingOption = this.shopOption.Printing.find(printItem =>
									printItem.PapeTrypeCode === obj2.PapeTrypeCode &&
									printItem.PCCode === obj2.PCCode &&
									printItem.PMCode === obj2.PMCode
								);

								if (matchingOption) {
									obj.PrintPCode = matchingOption.PrintPCode;
								}
							}
							if (tag.type === 'page') {
								obj.StartPage = tag.value
								obj.TrailerPage = tag.TrailerPage
							}
						});
						let imgList = []
						that.idCardloadImg1 != '' && imgList.push(that.idCardloadImg1)
						that.idCardloadImg2 != '' && imgList.push(that.idCardloadImg2)
						// 填充额外的字段
						obj.ShopID = this.$store.state.storeInfo.ID; // 店铺ID
						obj.DeviceCode = this.$store.state.storeInfo.DeviceCode; // 设备编码
						obj.FileCode = item.FileCode; // 文件编码
						obj.Price = item.price; // 文件价格
						obj.pageCount = item.generalPage; // 页数
						obj.Delivery_Province = this.addressInfo ? this.addressInfo.result.address_component
							.province : ''; // 省份
						obj.Delivery_City = this.addressInfo ? this.addressInfo.result.address_component.city :
							''; // 城市
						obj.URL = imgList.join(',')
						return obj;
					});

				// 处理结果数组
				if (arr.length > 0) {
					const res = await this.$api.post('OssFiles/SetOssPrintOrder', arr[0]);
					this.pay(res.data);
				} else {
					uni.showToast({
						title: '打印出错, 请重试',
						icon: 'none'
					});
				}
			} catch (error) {
				uni.showToast({
					title: '打印出错, 请重试',
					icon: 'none'
				});
				console.error('打印出错:', error); // 捕获并打印错误
			}
		},

		async pay(data) {
			let pres = await this.$api.post('/Polymerization/PayVJUhe', {
				body: data.EventType,
				ShopsID: this.$store.state.storeInfo.ID,
				EventType: data.EventType,
				EventID: data.EventID,
				CompanyID: 7006,
				SourcePage: '/pages/tab/home',

				// // #ifdef MP-WEIXIN
				// PayChannel: 'weixin',
				// // #endif
				// // #ifdef APP
				// PayChannel: 'app'
				// // #endif
			});

			let _this = this;
			let payObj = pres.data;

			uni.requestPayment({
				provider: 'wxpay',
				// #ifdef APP
				orderInfo: payObj,
				// #endif
				// #ifdef MP-WEIXIN
				timeStamp: payObj.timeStamp,
				nonceStr: payObj.nonceStr,
				package: payObj.package,
				signType: payObj.signType,
				paySign: payObj.paySign,
				// #endif
				success: async function (res) {
					_this.$pv.msg('支付成功');
					setTimeout(() => {
						// _this.closeAlert()
						// _this.upDateInfo();
					}, 500);
					_this.uploadFileList.forEach((item, index) => {
						// 只处理已选择的文件
						if (item.isSelect) {
							_this.$api.post('PrintedFiles/DeleteFile', {
								FileCode: item.FileCode
							})
						}
					});
					// _this.nav_back(2000);
				},
				fail: function (err) {
					_this.$pv.msg('您已取消支付');

				}
			});
		},
		// 关闭遮照弹窗
		closeUpLoadPop() {
			this.showChooseFile = false
		},
		// 获取优惠设置
		async getCouList() {
			let res = await this.$api.post('Printing/GetPromotion', {
				ShopID: this.$store.state.storeInfo.ID
			})
			this.couponList = res.data
		},

	}
};
</script>

<style lang="scss" scoped>
.confin {
	margin: 0 auto !important;
	border-radius: 50rpx !important;
}

.setting_list {
	display: flex;
	flex-direction: column;
	padding: 0rpx;

	.setting_item {

		.tags {
			padding: 5rpx 30rpx;
			box-sizing: content-box;
			border-radius: 40rpx;
			border: 1rpx solid #e7e7e7;
			margin-left: 15rpx;
		}

		.is_active {
			color: white;
			background-color: #3572fe;
		}

		display: flex;
		justify-content: space-between;
		align-items: center;
		height: 100rpx;
		border-bottom:1rpx solid #eeeeee;

		.right {
			display: flex;
			align-items: center;

		}
	}

}

.poup_container {
	box-sizing: border-box;
	padding: 30rpx;
	position: relative;


}

.plus {
	display: flex;
	justify-content: center;
	align-items: center;
	position: fixed;
	bottom: 120rpx;
	height: 100rpx;
	width: 100rpx;
	right: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: #3572fe;
	border-radius: 50%; // 使用百分比来简化圆形样式
	border: 5rpx solid white;
	box-shadow: 0rpx 0rpx 16rpx 0rpx rgba(194, 202, 216, 0.31);

	.plus_img {
		width: 100%;
		height: 100%;
	}

}

.print_button {
	height: 100%;
	width: 250rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	background-color: #0d78fa;
	font-size: 28rpx;
}


.select_all {
	padding-bottom: env(safe-area-inset-bottom);
	box-sizing: content-box;

	.select_all_price {
		font-size: 40rpx;
		font-weight: bold;
		margin-left: 30rpx;
		color: red;

		.delPrice {
			text-decoration: line-through;
			font-size: 34rpx;
			color: #999999;
			font-weight: 500;
			margin-left: 10rpx;
		}
	}

	.select_all_left {
		display: flex;
		align-items: center;

		.left {
			display: flex;
			align-items: center;

			image {
				width: 40rpx;
				height: 40rpx;
				margin-right: 10rpx;
			}
		}
	}



	.cantpay {
		background-color: #e6e6eb;
	}

	display: flex;
	align-items: center;
	position: fixed;
	bottom: 0;
	height: 100rpx;
	padding-left: 20rpx;
	width: 100%;
	justify-content: space-between;
	z-index: 99;
	background-color: #ffffff;
}

.file_list {
	image {
		width: 30rpx;
		height: 30rpx;
		margin-right: 10rpx;
	}

	display: flex;
	flex-direction: column;
	padding: 20rpx;
	// background-color: #f5f6f7;
	margin-top: 20rpx;

	.file_item {
		margin-bottom: 20rpx;
		border-radius: 20rpx;
		background-color: #ffffff;
		box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.08);
		border-radius: 16rpx;

		.top {
			display: flex;
			justify-content: space-between;
			align-items: center;
			font-size: 30rpx;
			margin-bottom: 20rpx;
		}

		.center {
			font-size: 26rpx;
			display: flex;
			margin: 10rpx 0;
			justify-content: space-between;
			align-items: center;

			.tag {
				padding: 5rpx 20rpx;
				box-sizing: content-box;
				background-color: #f5f5f7;
				margin-right: 10rpx;
				border-radius: 50rpx;
			}
		}

		.bottom {
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 20rpx;

			.price {
				color: red;
				font-weight: bold;
			}

			.status {
				display: flex;
				align-content: center;
			}

			.status_item {
				display: flex;
				align-items: center;
				margin-right: 20rpx;

				text {
					font-size: 26rpx;
				}
			}
		}

		display: flex;
		justify-content: space-around;
		align-items: center;
		padding: 20rpx;
	}

	.left {
		display: flex;
		align-items: center;

		image {
			width: 40rpx;
			height: 40rpx;
		}
	}

	.right {
		display: flex;
		justify-content: space-between;
		flex-direction: column;
		flex: 1;
		// margin-left: 20rpx;
	}
}

.swiper_contanier {
	width: 702rpx;
	margin: 0 auto;
	height: 300rpx;
}

.block_box {
	height: 196rpx;
}

.img_box {
	position: absolute;
	width: 100%;
	height: 500rpx;
	top: 0;

	image {
		width: 100%;
		height: 100%;
	}
}

page {
	background-color: #ffffff;
}


view {
	box-sizing: border-box;
}

.logo {
	box-sizing: border-box;
	height: 44px;
	width: 750rpx;
	// background: #ffffff;
	position: relative;
	display: flex;
	align-items: center;

	>image {
		position: absolute;
		left: 24rpx;
		bottom: 0;
		width: 30%;
		height: 90%;
	}

	.changeCompanyBox {
		padding: 18rpx 36rpx;
		border-radius: 36rpx;
		display: flex;
		align-items: center;

		text {
			font-weight: bold;
			font-size: 36rpx;
			color: #000000;
		}

	}
}

.assistant {
	position: relative;
	padding-bottom: 150rpx;
	// height: 100vh;
	// overflow: hidden;
}

.fix {
	position: fixed;
	width: 750rpx;
	top: 0;
	left: 0;
	z-index: 98;
	// background-color: #fff;
}

.topImgBox {
	width: 100%;

	.carPicBox {
		width: 100%;
		padding: 30rpx 52rpx;
	}

	.idcardimg {
		width: 582rpx;
		height: 364rpx;
		margin: 0 auto;
		position: relative;

		&:first-child {
			margin-bottom: 30rpx;
		}

		image {
			width: 100%;
			height: 100%;
			margin-right: 0;
			display: block;
		}

		.closeImg {
			position: absolute;
			width: 48rpx;
			height: 48rpx;
			right: 24rpx;
			top: 24rpx;
		}
	}
}
</style>